use dataset, clear

ssc install estout, replace

gen inft = .
replace inft = ft_dem if pid3 == "Democrat"
replace inft = ft_rep if pid3 == "Republican"

replace ideology = -abs(ideology-4)
su ideology
replace ideology = (ideology - r(min)) / (r(max) - r(min))

su year
replace year = year - r(min)
gen ideologyXyear = ideology*year

eststo clear
eststo, title("Republicans"): reg inft ideology year ideologyXyear ///
	if pid3 == "Republican" [aw=weight], cl(year)
eststo, title("Republicans"): reg inft ideology year ideologyXyear i.year ///
	if pid3 == "Republican" [aw=weight], cl(year)

eststo, title("Democrats"): reg inft ideology year ideologyXyear  ///
	if pid3 == "Democrat" [aw=weight], cl(year)
eststo, title("Democrats"): reg inft ideology year ideologyXyear i.year ///
	if pid3 == "Democrat" [aw=weight], cl(year)
esttab, se keep(ideology year ideologyXyear) mtitles
